package cn.ainit.bj.AutorSubmission;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import cn.ainit.bj.AutorSubmission.entity.BjAutorSubmission;
import cn.ainit.sys.common.dao.BusinessBaseDao;
@Transactional
@Repository("AutorSubmissionDao") //这里要改一个名字
public class AutorSubmissionDaoImpl extends BusinessBaseDao implements AutorSubmissionDao {

	@Override
	public boolean saveAutorSubmission(BjAutorSubmission bjAutorSubmission) throws Exception{
		try {
			this.sessionFactory.getCurrentSession().save(bjAutorSubmission);//参数改为上面的参数名称
			return true;


		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}

	@Override
	public boolean updAutorSubmissionSave(BjAutorSubmission bjAutorSubmission) throws Exception{
		try {
			this.getSessionFactory().getCurrentSession().update(bjAutorSubmission);//参数改为上面的参数名称
			return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	@Override
	public boolean findAutorSubmission(String JIAOGAO_ID) throws Exception {
		try {
			BjAutorSubmission bjAutorSubmission = (BjAutorSubmission) this.getSessionFactory().getCurrentSession().get(BjAutorSubmission.class, JIAOGAO_ID);
			if (bjAutorSubmission != null) {
				return true;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}

//	@Override
//	public boolean findbjAutorSubmission(String JIAOGAO_ID) throws Exception {
//		// TODO Auto-generated method stub
//		return false;
//	}
}
